package homework;

public class Homework1 {
	public static void main(String[] args) {
		char[] arr = {'a','b','d','e','d','w','u'};
		char find = 'm';
		// 保存被找的下标，默认值为-1，没找到就是-1
		int index = -1;
		
		for(int i = 0 ; i < arr.length ; i++) {
			if (arr[i] == find) {
				// 如果一旦找到就赋值下标
				index = i;
				break;
			}
		}
		System.out.println(index);
	}
}
